********************************************************************************************************************************************
********************************************************************************************************************************************
******************** 	REPLICATION FOR: 																	  	****************************
********************	New Socialist Men (and Women)? Communist Industrial Workplace and Political Engagement in China 	****************
********************************************************************************************************************************************
********************************************************************************************************************************************
********************************************************************************************************************************************

** Author: Jing Xu, Junyan Jiang, and Tianguang Meng
** Last Updated: ebruary 12, 2025
** Environment: 
*** Stata/MP 17.0
*** Windows 10 x64, Intel i-7-7500U
*** 16GB RAM




cd "/Users/crystalxu/Dropbox/paper/analysis/TF/replication"

use "Data_City.dta",clear

/*Main outcome variable*/
gen totalper=petition_total/population


/*Instrument*/
egen d_us = rowmin(dj1 dj2 dj3 dk1 dk2 dt1 dt2)


/*Main control group*/
global cov soe_employee_change gdpper population expenditure PAemployee soe_industrial_worker2013 response_rate capital






***************************************************************************
***************************************************************************
**********Table 1: Comparing TF and non-TF cities**************************
***************************************************************************
***************************************************************************

estpost ttest industrialenterprises1911 mines20th ln_dist2rail62 lnpop1953 sexratio1963 nonagrpro1964 lnlms lmsemp_nm_emp82_rt heavyioutput1985 ln_dist2rail80  lnpop1982 sexratio1982 illiterate1982 urbanpop1982 lnsoeenterprise2004 soe_employees2004 lndistrail2010 lnpop2010 sexratio100 illiterate2010 urbanpop2010 unemployment2010 if tier==1, by(thirdfront)


esttab . using a.txt, cells("mu_1(fmt(3)) mu_2(fmt(3)) b(star fmt(3))") ///
    collabels("Non-TF cities" "TF cities" "Difference") ///
    star(+ 0.10 * 0.05 ** 0.01) replace nomtitle nonumber noobs label

	
	
****************************************************************
****************Table 2: Baseline Results***********************
****************************************************************
****************************************************************


/*All prefectures*/
eststo clear
eststo m1: reg totalper  thirdfront   i.provid,robust
estadd local pf "\(\checkmark\)"

eststo m2: reg totalper thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m3:ivregress 2sls totalper   $cov (thirdfront=Rdls d_us) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

/*Within TF region*/
eststo m4: reg totalper   thirdfront   i.provid   if tier3==1,robust
estadd local pf "\(\checkmark\)"

eststo m5: reg totalper  thirdfront   $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m6:ivregress 2sls totalper  $cov    (thirdfront = Rdls d_us) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront soe_employee_change soe_industrial_worker2013 PAemployee gdpper  population expenditure  response_rate) b(3) se(3) ///
order(thirdfront soe_employee_change soe_industrial_worker2013 PAemployee gdpper  population expenditure  response_rate)   ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
title("Baseline Results") ///
mtitles( "OLS" "OLS" "2SLS" "OLS" "OLS" "2SLS" ) ///
mgroup("All prefectures" "Within third tier", pattern(1 0 0 1 0 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )


********************************************************************************
********************************************************************************
*******Figure 3: The Effect of Third Front City on Petitions by Topics**********
********************************************************************************
********************************************************************************


/*by topics*/
gen t1=topic_t1/population
gen t2=topic_t2/population
gen t3=topic_t3/population
gen t4=topic_t4/population
gen t5=topic_t5/population
gen t6=topic_t6/population
gen t7=topic_t7/population
gen t8=topic_t8/population
gen t9=topic_t9/population
gen t10=topic_t10/population
gen t11=topic_t11/population
gen t12=topic_t12/population
gen t13=topic_t13/population
gen t14=topic_t14/population

/*All prefectures*/
eststo clear
eststo m1: reg t1 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m2: reg t2 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m3: reg t3 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m4: reg t4 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m5: reg t5 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m6: reg t6 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m7: reg t7 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m8: reg t8 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m9: reg t9 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m10: reg t10 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m11: reg t11 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m12: reg t12 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m13: reg t13 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m14: reg t14 thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"


****************************************************************
****************************************************************
****************Table 4: TF Cities and Protests*****************
****************************************************************
****************************************************************


/*protest evidence*/

gen protest_CASM=CASM/population
gen protest_Manfred=Manfred/population

/*CASM*/
eststo clear
eststo m1: reg protest_CASM thirdfront   i.provid,robust
estadd local pf "\(\checkmark\)"

eststo m2: reg protest_CASM thirdfront $cov  i.provid,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m3:ivregress 2sls protest_CASM $cov (thirdfront=Rdls d_us) 
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

/*Manfred*/
eststo m4: reg protest_Manfred thirdfront  i.provid,robust
estadd local pf "\(\checkmark\)"
eststo m5: reg protest_Manfred thirdfront $cov  i.provid,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m6:ivregress 2sls protest_Manfred $cov (thirdfront=Rdls d_us) 
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

esttab m*  using out.txt, nonote nobaselevels keep(thirdfront) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
title("Baseline Results") ///
mtitles( "OLS" "OLS" "2SLS" "OLS" "OLS" "2SLS" ) ///
mgroup("CASM-China" "China Strikes", pattern(1 0 0 1 0 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a  N, labels("Province FE" "City-level controls" "Adjusted R\(^2\)"   "Observations") fmt(0 0  2 0) )


****************************************************************
****************************************************************
****************Table A.4: First-Stage Results******************
****************************************************************
****************************************************************


/*First-Stage Results*/

eststo clear
eststo m1: reg thirdfront d_us  $cov i.capital,robust
estadd local control "\(\checkmark\)"
eststo m2: reg thirdfront Rdls $cov i.capital,robust
estadd local control "\(\checkmark\)"
eststo m3: reg thirdfront Rdls d_us $cov i.capital,robust
estadd local control "\(\checkmark\)"

esttab m*  using out.txt, nonote nobaselevels keep(Rdls d_us) order(d_us Rdls ) b(4) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
nomtitles ///
mgroup("DV: Whether the city is Third-Front Movement city", pattern(1 0 0  ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats( control r2_a N, labels( "City-level controls"  "Adjusted R\(^2\)" "Observations") fmt(0 2 0) )


**********************************************************************************
**********************************************************************************
****************Table A.5: Results From Using a Single Instrument*****************
**********************************************************************************
**********************************************************************************


/*All prefectures*/

eststo m1:ivregress 2sls totalper   $cov (thirdfront= d_us) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust

eststo m2:ivregress 2sls totalper   $cov (thirdfront=Rdls) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust

/*Within TF region*/

eststo m3:ivregress 2sls totalper  $cov    (thirdfront = d_us) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust

eststo m4:ivregress 2sls totalper  $cov    (thirdfront = Rdls) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust

esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "IV = min.dist to US" "IV = terrain ruggedness" "IV = min.dist to US" "IV = terrain ruggedness" ) ///
mgroup("All prefectures" "Within third tier", pattern(1 0 1 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )


************************************************************************************************************
************************************************************************************************************
****************Table A.6: Using Distance to the Soviet Union as An Instrument for TF City******************
************************************************************************************************************
************************************************************************************************************

/* an instrument for the Soviet*/

eststo clear
eststo m1:ivregress 2sls totalper   $cov (thirdfront=Rdls mindis_Su)   ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

eststo m2:ivregress 2sls totalper   $cov (thirdfront=Rdls mindis_M)   ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

esttab m1 m2  using out.txt, nonote nobaselevels keep(thirdfront) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
nomtitles ///
mgroup("Distance to the Soviet Union" "Distance to Mongolia", pattern(1 1 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(control F  N, labels( "City-level controls"  "First-stage F"  "Observations") fmt( 0 2 0) )


************************************************************************
************************************************************************
****************Figure A.2: Robustness: Results by Year*****************
************************************************************************
************************************************************************

/****By Year****/
gen p2008_=p2008/population
gen p2009_=p2009/population
gen p2010_=p2010/population
gen p2011_=p2011/population
gen p2012_=p2012/population
gen p2013_=p2013/population
gen p2014_=p2014/population
gen p2015_=p2015/population
gen p2016_=p2016/population
gen p2017_=p2017/population
gen p2018_=p2018/population

/*All prefectures*/

eststo clear
eststo m1: reg p2008_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m2: reg p2009_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m3: reg p2010_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m4: reg p2011_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m5: reg p2012_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m6: reg p2013_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m7: reg p2014_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m8: reg p2015_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m9: reg p2016_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m10: reg p2017_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m11: reg p2018_ thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

/*Within TF region*/

eststo clear
eststo m1: reg p2008_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m2: reg p2009_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m3: reg p2010_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m4: reg p2011_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m5: reg p2012_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m6: reg p2013_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m7: reg p2014_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m8: reg p2015_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m9: reg p2016_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m10: reg p2017_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m11: reg p2018_ thirdfront  $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"


************************************************************************************
************************************************************************************
****************Table A.9: Robustness: Results by Petition Category*****************
************************************************************************************
************************************************************************************


/*by Categories*/

gen zixun_=zixun/population
gen jianyan_=jianyan/population
gen ganxie_=ganxie/population
gen tousu_=tousu/population
gen qiuzhu_=qiuzhu/population

eststo clear
eststo m1: reg zixun_ thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m2: reg zixun_ thirdfront $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m3: reg jianyan_ thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m4: reg jianyan_ thirdfront $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m5: reg ganxie_ thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m6: reg ganxie_ thirdfront $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m7: reg tousu_ thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m8: reg tousu_ thirdfront $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m9: reg qiuzhu_ thirdfront $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m10: reg qiuzhu_ thirdfront $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

esttab m*   using out.txt, nonote nobaselevels keep(thirdfront) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles("nationwide" "third-thier" "nationwide" "third-thier" "nationwide" "third-thier" "nationwide" "third-thier" "nationwide" "third-thier" ) mgroup("Consult" "Suggest" "Thank" "Complain" "Seek for Help" , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf cf r2_a N, labels( "Province FE" "City-level controls"  "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )




***********************************************************************************************
***********************************************************************************************
****************Table A.10: Robustness: Petitions at City-Level Message Boards*****************
***********************************************************************************************
***********************************************************************************************


/****City-Level Message****/
gen pcity=petition_citylevel/population

eststo clear
eststo m1: reg pcity thirdfront  $cov i.provid, robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m2:ivregress 2sls pcity  $cov (thirdfront=Rdls d_us), robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

eststo m3: reg pcity thirdfront   $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m4:ivregress 2sls pcity  $cov    (thirdfront = Rdls d_us) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid


esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "OLS" "2SLS" "OLS" "2SLS" ) ///
mgroup("All prefectures" "Within third tier", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf control  r2_a N, labels("Province FE" "City-level controls"  "Adjusted R\(^2\)"  "Observations") fmt(0 0 2 0) )


***********************************************************************************
***********************************************************************************
****************Table A.11: Robustness: Urban vs. Rural Comparison*****************
***********************************************************************************
***********************************************************************************


gen petition_urban=urban_petition/population
gen petition_rural=rural_petition/population

/*All prefectures*/
eststo clear
eststo m1: reg petition_urban  thirdfront $cov  i.provid,robust
estadd local pf "\(\checkmark\)"

eststo m2: reg petition_rural thirdfront  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

/*Within TF region*/
eststo m4: reg petition_urban  thirdfront $cov  i.provid   if tier3==1,robust
estadd local pf "\(\checkmark\)"

eststo m5: reg petition_rural thirdfront   $cov i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront $cov) b(3) se(3) ///
order(thirdfront $cov)   ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "Urban" "Rural" "Urban" "Rural") ///
mgroup("All prefectures" "Within TF region", pattern(1 0 1 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )



************************************************************************************************
************************************************************************************************
****************Table A.12: Robustness: Alternative Measures of Danwei Strength*****************
************************************************************************************************
************************************************************************************************


eststo clear
eststo m1: reg totalper first5  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m2: reg totalper employee1980  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m3: reg totalper workers1985  $cov i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

esttab m* using out.txt, nonote nobaselevels keep(first5 employee1980  workers1985) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles("All prefectures" "All prefectures" "All prefectures") mgroup("156 Project" "General SOE Presence" , pattern(1  1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels( "Province FE" "City-level controls"  "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )


***********************************************************************************************************
***********************************************************************************************************
****************Table A.13: Robustness: Additional Controls for Socioeconomic Conditions ******************
***********************************************************************************************************
***********************************************************************************************************

global cov_socieco nonagri unemployment students internetuser

eststo clear

/*All prefectures*/

eststo m1: reg totalper thirdfront $cov $cov_socieco i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m2:ivregress 2sls totalper $cov  $cov_socieco (thirdfront=Rdls d_us) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

/*Within TF region*/

eststo m3: reg totalper  thirdfront $cov  $cov_socieco i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m4:ivregress 2sls totalper $cov $cov_socieco (thirdfront = Rdls d_us) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront $cov_socieco) b(3) se(3) ///
order(thirdfront $cov_socieco)   ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "OLS" "IV" "OLS" "IV" ) ///
mgroup("All prefectures" "Within TF region", pattern(1 0 1 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )



***************************************************************************************************
*************************************************************************************************** 
****************Table A.15: Robustness: Accounting for Concurrent Political Events*****************
***************************************************************************************************
***************************************************************************************************



/*Other Political Events*/
/*cultural revolution & send-down youth*/

/*All prefectures*/
eststo clear
eststo m1: reg totalper thirdfront senddown $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m2: reg totalper thirdfront senddown CRdeath_pop_prefecture $cov i.capital i.provid,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

/*Within TF region*/
eststo m3: reg totalper thirdfront senddown $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m4: reg totalper thirdfront senddown CRdeath_pop_prefecture $cov i.capital i.provid if tier3==1,robust
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

esttab m*  using out.txt, nonote nobaselevels keep(thirdfront senddown CRdeath_pop_prefecture) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
nomtitles mgroup("All prefectures" "Within third tier", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf cf r2_a N, labels( "Province FE" "City-level controls"  "Adjusted R\(^2\)" "Observations") fmt( 0 0 2 0) )

***************************************************************************************************
***************************************************************************************************
****************Table A.16: Robustness: Additional Controls for Pre-TF Culture*********************
***************************************************************************************************
***************************************************************************************************


global cov_pre confucian_temples taoist_temples buddhist_temples catholic_churches jinshi genealogies

/*All prefectures*/
eststo clear

eststo m2: reg totalper thirdfront $cov  $cov_pre i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m3:ivregress 2sls totalper $cov  $cov_pre (thirdfront=Rdls d_us) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

/*Within TF region*/

eststo m5: reg totalper  thirdfront $cov  $cov_pre i.provid if tier3==1,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

eststo m6:ivregress 2sls totalper $cov $cov_pre (thirdfront = Rdls d_us) if tier3==1, robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

esttab m*  using out.txt, nonote nobaselevels   keep(thirdfront $cov_pre) b(3) se(3) ///
order(thirdfront $cov_pre)   ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "OLS" "IV" "OLS" "IV" ) ///
mgroup("All prefectures" "Within TF region", pattern(1 0 1 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )

***************************************************************************************************
***************************************************************************************************
**********Table A.17: Robustness: Additional Controls for Prior Revolutionary Activities***********
***************************************************************************************************
***************************************************************************************************


gen lnsoldier_death_1949=ln(soldier_death_1949)
gen lnpartyelite=ln(partyelite)
gen lnpm_1949=ln(pm_1949)
label var lnsoldier_death_1949 "\# of martyrs before 1949 (logged)"
label var lnpartyelite "\# of party elites before 1949 (logged)"
label var lnpm_1949 "\# of party members before 1949 (logged)"

global cov_revo lnsoldier_death_1949 lnpartyelite lnpm_1949


eststo clear
/*全国OLS*/
eststo m1: reg totalper thirdfront  $cov $cov_revo  i.provid ,robust
estadd local control "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

/*全国2SLS*/
eststo m2:ivregress 2sls totalper   $cov  $cov_revo   (thirdfront=Rdls d_us) ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid

/* within 3线 OLS*/
eststo m3: reg totalper   thirdfront  $cov $cov_revo  i.provid   if tier3==1,robust
estadd local pf "\(\checkmark\)"
estadd local control "\(\checkmark\)"

/* within 3线 IV */
eststo m4:ivregress 2sls totalper   $cov  $cov_revo  (thirdfront=Rdls d_us) if tier3==1 ,robust
estadd local control "\(\checkmark\)"
estat endog
estat firststage, all forcenonrobust
estat overid



esttab m1 m2 m3 m4 using out.txt, nonote nobaselevels   keep(thirdfront  $cov_revo ) b(3) se(3) ///
order(thirdfront  $cov_revo )   ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
mtitles( "OLS"  "IV" "OLS" "IV" ) ///
mgroup("All prefectures" "Within third tier", pattern(1 0   1 0   ) prefix(\multicolumn{@span}{c}{) suffix(}) ///
span erepeat(\cmidrule(lr){@span})) ///
stats(pf control r2_a N, labels("Province FE" "City-level controls"   "Adjusted R\(^2\)" "Observations") fmt(0 0 2 0) )


***************************************************************************************************
***************************************************************************************************
**********Table A.14: Robustness: Accounting for Spatial Contagion Effects*************************
***************************************************************************************************
***************************************************************************************************





eststo clear
eststo m1:spregress totalper thirdfront  i.capital i.provid , gs2sls dvarlag(W) ivarlag(W:thirdfront) force
estadd local pf "\(\checkmark\)"
eststo m2:spregress totalper thirdfront $cov  i.capital i.provid , gs2sls dvarlag(W) ivarlag(W:thirdfront) force
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"
eststo m3:spregress totalper thirdfront  i.capital i.provid if tier3==1, gs2sls dvarlag(W) ivarlag(W:thirdfront) force
estadd local pf "\(\checkmark\)"
eststo m4:spregress totalper thirdfront $cov i.capital i.provid if tier3==1, gs2sls dvarlag(W) ivarlag(W:thirdfront) force
estadd local cf "\(\checkmark\)"
estadd local pf "\(\checkmark\)"

esttab m*  using out.txt, nonote nobaselevels keep(thirdfront totalper) b(3) se(3) ///
star(+ 0.1 * 0.05 ** 0.01) label booktabs replace   ///
nomtitles mgroup("All prefectures" "Within third tier", pattern(1 0  1 0  ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(pf cf r2_p N, labels(  "Province FE" "City-level controls"  "Pseudo R2" "Observations") fmt(0 0 2 0) )



